//
//  visitTableViewController.swift
//  weibo1
//
//  Created by 李进 on 15/10/15.
//  Copyright © 2015年 李进. All rights reserved.
//

import UIKit

class visitTableViewController: UITableViewController {
    
    
    var visitview: visitView?
    /// 记录用户在线的状态
    private var loginBool = userAccViewModel.shareAccViewModel.isLogin


    /// 判断用户是否登录
    override func loadView() {
      
        loginBool ? super.loadView() : (setupview())
    }
    
    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        
        //print(visitview)
    }
    
    func setupview(){
        
        
        visitview = visitView()
        
        visitview?.reginBut.addTarget(self, action: "regClick", forControlEvents: UIControlEvents.TouchUpInside)
        
        visitview?.loginBut.addTarget(self, action: "logClick", forControlEvents: UIControlEvents.TouchUpInside)
        
        view = visitview
    }
    
    //点击事件
    func regClick(){
        
        //print("注册")
        print("注册")
        
        
    }
    
    func logClick(){
        //print("denglu")
        
        let vc = WBLgjumupViewController()
        
        vc.view.backgroundColor = UIColor.whiteColor()
        
        let nav = UINavigationController(rootViewController: vc)
        
       navigationController?.presentViewController(nav, animated: true, completion: nil)
        
        
    }
}